let marbleRaceLevel11_4 = {
	name: 'Game 11 Level 4',
	id: '11_4',
	type: 'elimination',
	eliminated: 1,
	objects: [
		// Portals
		{
			type: 'object',
			shape: 'rect',
			color: '@goal',
			toPortal: 'goal',
			isGoal: true,
			x: 340,
			y: 540 - 10,
			width: 520,
			height: 20
		},
		{
			type: 'object',
			shape: 'circle',
			color: '@a',
			portalID: 'a',
			x: 340,
			y: 80,
			radius: 5
		},

		// Goal portal
		{
			type: 'object',
			shape: 'circle',
			color: '@goal',
			portalID: 'goal',
			x: 700,
			y: 80,
			radius: 5
		},

		// Borders
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 400,
			y: 0,
			width: 800,
			height: 120
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 400,
			y: 600,
			width: 800,
			height: 120
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 0,
			y: 300,
			width: 160,
			height: 600
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 800,
			y: 300,
			width: 160,
			height: 600
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 640,
			y: 300,
			width: 80,
			height: 600
		},

		// Marbles
		{
			type: 'marbles',
			x: 340,
			y: 80,
			launchTime: 3,
			launchRadius: 75,
			passX: 700,
			passY: 80,
			radius: 8,
			eliminatedRadius: 6,
			velocity: 5
		},
	]
}
for (let i = 0; i < 6; ++i) {
	let x0 = 340
	let y0 = 150 + 60 * i
	marbleRaceLevel11_4.objects.push({
		type: 'object',
		shape: 'circle',
		color: '@a',
		toPortal: 'a',
		x: x0,
		y: y0,
		radius: 30,
		onBeforeUpdate: function (object, engine) {
			let phase = engine.time - .1 * i
			phase -= Math.floor(phase)
			engine.setPosition(object.body, [80 + 520 * phase, y0])
		}
	})
}
for (let i = 0; i < 6; ++i) {
	let x0 = 340
	let y0 = 150 + 60 * i
	marbleRaceLevel11_4.objects.push({
		type: 'object',
		shape: 'circle',
		color: '@a',
		toPortal: 'a',
		x: x0,
		y: y0,
		radius: 30,
		onBeforeUpdate: function (object, engine) {
			let phase = engine.time + .1 * i
			phase -= Math.floor(phase)
			engine.setPosition(object.body, [80 + 520 * phase, y0])
		}
	})
}
marbleRaceLevels.push(marbleRaceLevel11_4)